﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;

namespace EBA.IoC
{
    public static class AssemblyEx
    {
        public static IEnumerable<Type> TryGetTypes(this Assembly assembly)
        {
            Type[] typesInAsm;
            try
            {
                typesInAsm = assembly.GetTypes();
            }
            catch (ReflectionTypeLoadException ex)
            {
                typesInAsm = ex.Types;
            }

            return typesInAsm;
        }
    }
}
